package com.test.sink;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction;

public class DefindPrintSink<IN> extends RichSinkFunction<IN> {

    @Override
    public void open(Configuration parameters) throws Exception {
        super.open(parameters);
        System.out.println("open");
    }

    @Override
    public void invoke(IN value, Context context) throws Exception {
        System.out.println("invoke");
        System.out.println("输出结果:" + value);
    }

    @Override
    public void close() throws Exception {
        super.close();
        System.out.println("close");
    }
}
